package com.longcai.cm.service;

import com.longcai.cm.base.service.BaseServiceIface;
import com.longcai.cm.domain.FaMember;
import com.longcai.cm.domain.JaOrder;
import com.longcai.cm.exception.SysRuntimeException;
import com.longcai.cm.pay.ali.AliPayApi;
import com.longcai.cm.pay.wx.WxPayApp;
import com.longcai.cm.pay.wx.domain.WxRefundParam;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;

/**
 * @author LBX
 */
public interface JaOrderService extends BaseServiceIface<JaOrder> {

    /**
     * 创建订单
     *
     * @param order    订单信息
     * @param memberId 用户id
     * @param isVip    是否会员
     * @return 订单
     */
    JaOrder createOrder(JaOrder order, Integer memberId, Boolean isVip);

    /**
     * 交易完成 订单核验
     *
     * @param orderId   订单id
     * @param tradeNo   三方交易号
     * @param payAmount 实付金额
     * @param payType   支付类型
     */
    void tradeFinish(String orderId, String tradeNo, BigDecimal payAmount, int payType);

    /**
     * 核销订单 结算收益
     *
     * @param orderId 订单id
     * @param member  用户id
     */
    void checkOrder(String orderId, FaMember member);


    String refundOrder(BigDecimal refundAmount, BigDecimal totalAmount, String orderNum, Integer payType);
}
